package com.appclub.kitsilano;

import com.actionbarsherlock.app.SherlockActivity;

import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.LinearLayout;

public class Jimo extends SherlockActivity {
	private MediaPlayer mp;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.jimo);
		mp = MediaPlayer.create(this, R.raw.jimo);
		mp.start();
		LinearLayout jimo = (LinearLayout) findViewById(R.id.jimolayout);
		jimo.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				mp.start();
			}
		});
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
			Intent intent = new Intent(this, MainActivity.class);
			startActivity(intent);
			overridePendingTransition(R.anim.right_in, R.anim.right_out);
			this.finish();
		}
		return true;
	}
}